home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Text / WASTE / WASTE 1.1.2 Distribution / Pseudo-UPI for THINK Pascal / Sound.p < prev    next >
Encoding:
Text File  |  1995-10-12  |  16.7 KB  |  543 lines  |  [TEXT/PJMM]

  1. unit Sound;
  2.  
  3. { Pascal Interface to the Macintosh Libraries }
  4.  
  5. { Copyright © Apple Computer Inc. }
  6. { All Rights Reserved }
  7.  
  8. { Adapted for use with THINK Pascal 4.0.x by Marco Piovanelli }
  9.  
  10. interface
  11.     uses
  12.         Types;
  13.  
  14.     const
  15.  
  16.         twelfthRootTwo = 1.05946309434;
  17.         soundListRsrc = 'snd ';                        {Resource type used by Sound Manager}
  18.         rate44khz = $AC440000;                    {44100.00000 in fixed-point}
  19.         rate22050hz = $56220000;                    {22050.00000 in fixed-point}
  20.         rate22khz = $56EE8BA3;                    {22254.54545 in fixed-point}
  21.         rate11khz = $2B7745D1;                    {11127.27273 in fixed-point}
  22.         rate11025hz = $2B110000;                    {11025.00000 in fixed-point}
  23.  
  24. {synthesizer numbers for SndNewChannel}
  25.         squareWaveSynth = 1;                            {square wave synthesizer}
  26.         waveTableSynth = 3;                            {wave table synthesizer}
  27.         sampledSynth = 5;                            {sampled sound synthesizer}
  28.  
  29. {old Sound Manager MACE synthesizer numbers}
  30.         MACE3snthID = 11;
  31.         MACE6snthID = 13;
  32.         kMiddleC = 60;                            {MIDI note value for middle C}
  33.         kSimpleBeepID = 1;                            {reserved resource ID for Simple Beep}
  34.         kFullVolume = $0100;                        {1.0, setting for full hardware output volume}
  35.         kNoVolume = 0;                            {setting for no sound volume}
  36.  
  37. {command numbers for SndDoCommand and SndDoImmediate}
  38.         nullCmd = 0;
  39.         initCmd = 1;
  40.         freeCmd = 2;
  41.         quietCmd = 3;
  42.         flushCmd = 4;
  43.         reInitCmd = 5;
  44.         waitCmd = 10;
  45.         pauseCmd = 11;
  46.         resumeCmd = 12;
  47.         callBackCmd = 13;
  48.  
  49.         syncCmd = 14;
  50.         availableCmd = 24;
  51.         versionCmd = 25;
  52.         totalLoadCmd = 26;
  53.         loadCmd = 27;
  54.         freqDurationCmd = 40;
  55.         restCmd = 41;
  56.         freqCmd = 42;
  57.         ampCmd = 43;
  58.         timbreCmd = 44;
  59.         getAmpCmd = 45;
  60.         volumeCmd = 46;                            {sound manager 3.0 or later only}
  61.         getVolumeCmd = 47;                            {sound manager 3.0 or later only}
  62.         waveTableCmd = 60;
  63.         phaseCmd = 61;
  64.  
  65.         soundCmd = 80;
  66.         bufferCmd = 81;
  67.         rateCmd = 82;
  68.         continueCmd = 83;
  69.         doubleBufferCmd = 84;
  70.         getRateCmd = 85;
  71.         rateMultiplierCmd = 86;
  72.         getRateMultiplierCmd = 87;
  73.         sizeCmd = 90;
  74.         convertCmd = 91;
  75.         stdQLength = 128;
  76.         dataOffsetFlag = $8000;
  77.  
  78. {channel initialization parameters}
  79.         initChanLeft = $0002;                        {left stereo channel}
  80.         initChanRight = $0003;                        {right stereo channel}
  81.         initNoInterp = $0004;                        {no linear interpolation}
  82.         initNoDrop = $0008;                        {no drop-sample conversion}
  83.         initMono = $0080;                        {monophonic channel}
  84.         initStereo = $00C0;                        {stereo channel}
  85.         initMACE3 = $0300;                        {MACE 3:1}
  86.         initMACE6 = $0400;                        {MACE 6:1}
  87.         initPanMask = $0003;                        {mask for right/left pan values}
  88.         initSRateMask = $0030;                        {mask for sample rate values}
  89.         initStereoMask = $00C0;                        {mask for mono/stereo values}
  90.         initCompMask = $FF00;                        {mask for compression IDs}
  91.         kUseOptionalOutputDevice = -1;                            {only for Sound Manager 3.0 or later}
  92.         notCompressed = 0;                            {compression ID's}
  93.         fixedCompression = -1;                            {compression ID for fixed-sized compression}
  94.         variableCompression = -2;                            {compression ID for variable-sized compression}
  95.         twoToOne = 1;
  96.         eightToThree = 2;
  97.         threeToOne = 3;
  98.         sixToOne = 4;
  99.  
  100.         stdSH = $00;                            {Standard sound header encode value}
  101.         extSH = $FF;                            {Extended sound header encode value}
  102.         cmpSH = $FE;                            {Compressed sound header encode value}
  103.  
  104.         outsideCmpSH = 0;                            {MACE constants}
  105.         insideCmpSH = 1;
  106.         aceSuccess = 0;
  107.         aceMemFull = 1;
  108.         aceNilBlock = 2;
  109.         aceBadComp = 3;
  110.         aceBadEncode = 4;
  111.         aceBadDest = 5;
  112.         aceBadCmd = 6;
  113.         sixToOnePacketSize = 8;
  114.         threeToOnePacketSize = 16;
  115.         stateBlockSize = 64;
  116.         leftOverBlockSize = 32;
  117.         firstSoundFormat = $0001;                        {general sound format}
  118.         secondSoundFormat = $0002;                        {special sampled sound format (HyperCard)}
  119.         dbBufferReady = $00000001;                    {double buffer is filled}
  120.         dbLastBuffer = $00000004;                    {last double buffer to play}
  121.         sysBeepDisable = $0000;                        {SysBeep() enable flags}
  122.         sysBeepEnable = $0001;
  123.         unitTypeNoSelection = $FFFF;                        {unitTypes for AudioSelection.unitType}
  124.         unitTypeSeconds = $0000;
  125.  
  126. { unsigned fixed-point number }
  127.  
  128.     type
  129.         UnsignedFixed = LONGINT;
  130.  
  131.         SndCommand = packed record
  132.                 cmd: INTEGER;
  133.                 param1: INTEGER;
  134.                 param2: LONGINT;
  135.             end;
  136.         SndChannelPtr = ^SndChannel;
  137.  
  138.         SndCallBackProcPtr = ProcPtr;  { PROCEDURE SndCallBack(chan: SndChannelPtr; VAR cmd: SndCommand); }
  139.         SndCallBackUPP = UniversalProcPtr;
  140.  
  141.         SndChannel = packed record
  142.                 nextChan: ^SndChannel;
  143.                 firstMod: Ptr;                                    { reserved for the Sound Manager }
  144.                 callBack: SndCallBackUPP;
  145.                 userInfo: LONGINT;
  146.                 wait: LONGINT;                                { The following is for internal Sound Manager use only.}
  147.                 cmdInProgress: SndCommand;
  148.                 flags: INTEGER;
  149.                 qLength: INTEGER;
  150.                 qHead: INTEGER;
  151.                 qTail: INTEGER;
  152.                 queue: array[0..127] of SndCommand;
  153.             end;
  154. {MACE structures}
  155.         StateBlock = record
  156.                 stateVar: array[0..63] of INTEGER;
  157.             end;
  158.         StateBlockPtr = ^StateBlock;
  159.  
  160.         LeftOverBlock = record
  161.                 count: LONGINT;
  162.                 sampleArea: packed array[0..31] of CHAR;
  163.             end;
  164.         LeftOverBlockPtr = ^LeftOverBlock;
  165.  
  166.         ModRef = record
  167.                 modNumber: INTEGER;
  168.                 modInit: LONGINT;
  169.             end;
  170.         SndListResource = record
  171.                 format: INTEGER;
  172.                 numModifiers: INTEGER;
  173.                 modifierPart: array[0..0] of ModRef;                    {This is a variable length array}
  174.                 numCommands: INTEGER;
  175.                 commandPart: array[0..0] of SndCommand;                {This is a variable length array}
  176.                 dataPart: packed array[0..0] of CHAR;            {This is a variable length array}
  177.             end;
  178.         SndListPtr = ^SndListResource;
  179.  
  180.         SndListHndl = ^SndListPtr;
  181.         SndListHandle = ^SndListPtr;
  182.  
  183. {HyperCard sound resource format}
  184.         Snd2ListResource = record
  185.                 format: INTEGER;
  186.                 refCount: INTEGER;
  187.                 numCommands: INTEGER;
  188.                 commandPart: array[0..0] of SndCommand;                {This is a variable length array}
  189.                 dataPart: packed array[0..0] of CHAR;            {This is a variable length array}
  190.             end;
  191.         Snd2ListPtr = ^Snd2ListResource;
  192.  
  193.         Snd2ListHndl = ^Snd2ListPtr;
  194.         Snd2ListHandle = ^Snd2ListPtr;
  195.  
  196.         SoundHeader = packed record
  197.                 samplePtr: Ptr;                                    {if NIL then samples are in sampleArea}
  198.                 length: LONGINT;                                {length of sound in bytes}
  199.                 sampleRate: UnsignedFixed;                            {sample rate for this sound}
  200.                 loopStart: LONGINT;                                {start of looping portion}
  201.                 loopEnd: LONGINT;                                {end of looping portion}
  202.                 encode: CHAR;                                    {header encoding}
  203.                 baseFrequency: CHAR;                                    {baseFrequency value}
  204.                 sampleArea: packed array[0..0] of CHAR;            {space for when samples follow directly}
  205.             end;
  206.         SoundHeaderPtr = ^SoundHeader;
  207.  
  208.         CmpSoundHeader = packed record
  209.                 samplePtr: Ptr;                                    {if nil then samples are in sample area}
  210.                 numChannels: LONGINT;                                {number of channels i.e. mono = 1}
  211.                 sampleRate: UnsignedFixed;                            {sample rate in Apples Fixed point representation}
  212.                 loopStart: LONGINT;                                {loopStart of sound before compression}
  213.                 loopEnd: LONGINT;                                {loopEnd of sound before compression}
  214.                 encode: CHAR;                                    {data structure used , stdSH, extSH, or cmpSH}
  215.                 baseFrequency: CHAR;                                    {same meaning as regular SoundHeader}
  216.                 numFrames: LONGINT;                                {length in frames ( packetFrames or sampleFrames )}
  217.                 AIFFSampleRate: extended80;                                {IEEE sample rate}
  218.                 markerChunk: Ptr;                                    {sync track}
  219.                 format: OSType;                                    {data format type, was futureUse1}
  220.                 futureUse2: LONGINT;                                {reserved by Apple}
  221.                 stateVars: StateBlockPtr;                            {pointer to State Block}
  222.                 leftOverSamples: LeftOverBlockPtr;                        {used to save truncated samples between compression calls}
  223.                 compressionID: INTEGER;                                {0 means no compression, non zero means compressionID}
  224.                 packetSize: INTEGER;                                {number of bits in compressed sample packet}
  225.                 snthID: INTEGER;                                {resource ID of Sound Manager snth that contains NRT C/E}
  226.                 sampleSize: INTEGER;                                {number of bits in non-compressed sample}
  227.                 sampleArea: packed array[0..0] of CHAR;            {space for when samples follow directly}
  228.             end;
  229.         CmpSoundHeaderPtr = ^CmpSoundHeader;
  230.  
  231.         ExtSoundHeader = packed record
  232.                 samplePtr: Ptr;                                    {if nil then samples are in sample area}
  233.                 numChannels: LONGINT;                                {number of channels,  ie mono = 1}
  234.                 sampleRate: UnsignedFixed;                            {sample rate in Apples Fixed point representation}
  235.                 loopStart: LONGINT;                                {same meaning as regular SoundHeader}
  236.                 loopEnd: LONGINT;                                {same meaning as regular SoundHeader}
  237.                 encode: CHAR;                                    {data structure used , stdSH, extSH, or cmpSH}
  238.                 baseFrequency: CHAR;                                    {same meaning as regular SoundHeader}
  239.                 numFrames: LONGINT;                                {length in total number of frames}
  240.                 AIFFSampleRate: extended80;                                {IEEE sample rate}
  241.                 markerChunk: Ptr;                                    {sync track}
  242.                 instrumentChunks: Ptr;                                    {AIFF instrument chunks}
  243.                 AESRecording: Ptr;
  244.                 sampleSize: INTEGER;                                {number of bits in sample}
  245.                 futureUse1: INTEGER;                                {reserved by Apple}
  246.                 futureUse2: LONGINT;                                {reserved by Apple}
  247.                 futureUse3: LONGINT;                                {reserved by Apple}
  248.                 futureUse4: LONGINT;                                {reserved by Apple}
  249.                 sampleArea: packed array[0..0] of CHAR;            {space for when samples follow directly}
  250.             end;
  251.         ExtSoundHeaderPtr = ^ExtSoundHeader;
  252.  
  253.         ConversionBlock = record
  254.                 destination: INTEGER;
  255.                 unused: INTEGER;
  256.                 inputPtr: CmpSoundHeaderPtr;
  257.                 outputPtr: CmpSoundHeaderPtr;
  258.             end;
  259.         ConversionBlockPtr = ^ConversionBlock;
  260.  
  261.         SMStatus = packed record
  262.                 smMaxCPULoad: INTEGER;
  263.                 smNumChannels: INTEGER;
  264.                 smCurCPULoad: INTEGER;
  265.             end;
  266.         SMStatusPtr = ^SMStatus;
  267.  
  268.         SCStatus = record
  269.                 scStartTime: UnsignedFixed;
  270.                 scEndTime: UnsignedFixed;
  271.                 scCurrentTime: UnsignedFixed;
  272.                 scChannelBusy: BOOLEAN;
  273.                 scChannelDisposed: BOOLEAN;
  274.                 scChannelPaused: BOOLEAN;
  275.                 scUnused: BOOLEAN;
  276.                 scChannelAttributes: LONGINT;
  277.                 scCPULoad: LONGINT;
  278.             end;
  279.         SCStatusPtr = ^SCStatus;
  280.  
  281.         AudioSelection = packed record
  282.                 unitType: LONGINT;
  283.                 selStart: UnsignedFixed;
  284.                 selEnd: UnsignedFixed;
  285.             end;
  286.         FilePlayCompletionProcPtr = ProcPtr;  { PROCEDURE FilePlayCompletion(chan: SndChannelPtr); }
  287.         FilePlayCompletionUPP = UniversalProcPtr;
  288.  
  289.     const
  290.         uppFilePlayCompletionProcInfo = $000000C0; { PROCEDURE (4 byte param); }
  291.  
  292.     function NewFilePlayCompletionProc (userRoutine: FilePlayCompletionProcPtr): FilePlayCompletionUPP;
  293.     inline
  294.         $2E9F;
  295.  
  296.     procedure CallFilePlayCompletionProc (chan: SndChannelPtr;
  297.                                     userRoutine: FilePlayCompletionUPP);
  298.     inline
  299.         $205F, $4E90;
  300.  
  301.     type
  302.         AudioSelectionPtr = ^AudioSelection;
  303.  
  304.         SndDoubleBuffer = packed record
  305.                 dbNumFrames: LONGINT;
  306.                 dbFlags: LONGINT;
  307.                 dbUserInfo: array[0..1] of LONGINT;
  308.                 dbSoundData: packed array[0..0] of CHAR;
  309.             end;
  310.         SndDoubleBufferPtr = ^SndDoubleBuffer;
  311.  
  312.         SndDoubleBackProcPtr = ProcPtr;  { PROCEDURE SndDoubleBack(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr); }
  313.         SndDoubleBackUPP = UniversalProcPtr;
  314.  
  315.     const
  316.         uppSndDoubleBackProcInfo = $000003C0; { PROCEDURE (4 byte param, 4 byte param); }
  317.  
  318.     function NewSndDoubleBackProc (userRoutine: SndDoubleBackProcPtr): SndDoubleBackUPP;
  319.     inline
  320.         $2E9F;
  321.  
  322.     procedure CallSndDoubleBackProc (channel: SndChannelPtr;
  323.                                     doubleBufferPtr: SndDoubleBufferPtr;
  324.                                     userRoutine: SndDoubleBackUPP);
  325.     inline
  326.         $205F, $4E90;
  327.  
  328.     type
  329.         SndDoubleBufferHeader = packed record
  330.                 dbhNumChannels: INTEGER;
  331.                 dbhSampleSize: INTEGER;
  332.                 dbhCompressionID: INTEGER;
  333.                 dbhPacketSize: INTEGER;
  334.                 dbhSampleRate: UnsignedFixed;
  335.                 dbhBufferPtr: array[0..1] of SndDoubleBufferPtr;
  336.                 dbhDoubleBack: SndDoubleBackUPP;
  337.             end;
  338.         SndDoubleBufferHeaderPtr = ^SndDoubleBufferHeader;
  339.  
  340.         SndDoubleBufferHeader2 = packed record
  341.                 dbhNumChannels: INTEGER;
  342.                 dbhSampleSize: INTEGER;
  343.                 dbhCompressionID: INTEGER;
  344.                 dbhPacketSize: INTEGER;
  345.                 dbhSampleRate: UnsignedFixed;
  346.                 dbhBufferPtr: array[0..1] of SndDoubleBufferPtr;
  347.                 dbhDoubleBack: SndDoubleBackUPP;
  348.                 dbhFormat: OSType;
  349.             end;
  350.         SndDoubleBufferHeader2Ptr = ^SndDoubleBufferHeader2;
  351.  
  352.         SoundInfoList = packed record
  353.                 count: INTEGER;
  354.                 infoHandle: Handle;
  355.             end;
  356.         SoundInfoListPtr = ^SoundInfoList;
  357.  
  358.         CompressionInfo = record
  359.                 recordSize: LONGINT;
  360.                 format: OSType;
  361.                 compressionID: INTEGER;
  362.                 samplesPerPacket: INTEGER;
  363.                 bytesPerPacket: INTEGER;
  364.                 bytesPerFrame: INTEGER;
  365.                 bytesPerSample: INTEGER;
  366.                 futureUse1: INTEGER;
  367.             end;
  368.         CompressionInfoPtr = ^CompressionInfo;
  369.  
  370.         CompressionInfoHandle = ^CompressionInfoPtr;
  371.  
  372.     function SndDoCommand (chan: SndChannelPtr; {CONST}
  373.                                     var cmd: SndCommand;
  374.                                     noWait: BOOLEAN): OSErr;
  375.     inline
  376.         $A803;
  377.     function SndDoImmediate (chan: SndChannelPtr; {CONST}
  378.                                     var cmd: SndCommand): OSErr;
  379.     inline
  380.         $A804;
  381.     function SndNewChannel (var chan: SndChannelPtr;
  382.                                     synth: INTEGER;
  383.                                     init: LONGINT;
  384.                                     userRoutine: SndCallBackUPP): OSErr;
  385.     inline
  386.         $A807;
  387.     function SndDisposeChannel (chan: SndChannelPtr;
  388.                                     quietNow: BOOLEAN): OSErr;
  389.     inline
  390.         $A801;
  391.     function SndPlay (chan: SndChannelPtr;
  392.                                     sndHdl: SndListHandle;
  393.                                     async: BOOLEAN): OSErr;
  394.     inline
  395.         $A805;
  396.     function SndAddModifier (chan: SndChannelPtr;
  397.                                     modifier: Ptr;
  398.                                     id: INTEGER;
  399.                                     init: LONGINT): OSErr;
  400.     inline
  401.         $A802;
  402.     function SndControl (id: INTEGER;
  403.                                     var cmd: SndCommand): OSErr;
  404.     inline
  405.         $A806;
  406.  
  407. { Sound Manager 2.0 and later, uses _SoundDispatch }
  408.     function SndSoundManagerVersion: NumVersion;
  409.     inline
  410.         $203C, $000C, $0008, $A800;
  411.     function SndStartFilePlay (chan: SndChannelPtr;
  412.                                     fRefNum: INTEGER;
  413.                                     resNum: INTEGER;
  414.                                     bufferSize: LONGINT;
  415.                                     theBuffer: univ Ptr;
  416.                                     theSelection: AudioSelectionPtr;
  417.                                     theCompletion: FilePlayCompletionUPP;
  418.                                     async: BOOLEAN): OSErr;
  419.     inline
  420.         $203C, $0D00, $0008, $A800;
  421.     function SndPauseFilePlay (chan: SndChannelPtr): OSErr;
  422.     inline
  423.         $203C, $0204, $0008, $A800;
  424.     function SndStopFilePlay (chan: SndChannelPtr;
  425.                                     quietNow: BOOLEAN): OSErr;
  426.     inline
  427.         $203C, $0308, $0008, $A800;
  428.     function SndChannelStatus (chan: SndChannelPtr;
  429.                                     theLength: INTEGER;
  430.                                     theStatus: SCStatusPtr): OSErr;
  431.     inline
  432.         $203C, $0010, $0008, $A800;
  433.     function SndManagerStatus (theLength: INTEGER;
  434.                                     theStatus: SMStatusPtr): OSErr;
  435.     inline
  436.         $203C, $0014, $0008, $A800;
  437.     procedure SndGetSysBeepState (var sysBeepState: INTEGER);
  438.     inline
  439.         $203C, $0018, $0008, $A800;
  440.     function SndSetSysBeepState (sysBeepState: INTEGER): OSErr;
  441.     inline
  442.         $203C, $001C, $0008, $A800;
  443.     function SndPlayDoubleBuffer (chan: SndChannelPtr;
  444.                                     theParams: SndDoubleBufferHeaderPtr): OSErr;
  445.     inline
  446.         $203C, $0020, $0008, $A800;
  447.  
  448. { MACE compression routines }
  449.     function MACEVersion: NumVersion;
  450.     inline
  451.         $203C, $0000, $0010, $A800;
  452.     procedure Comp3to1 (inBuffer: univ Ptr;
  453.                                     outBuffer: univ Ptr;
  454.                                     cnt: LONGINT;
  455.                                     inState: univ Ptr;
  456.                                     outState: univ Ptr;
  457.                                     numChannels: LONGINT;
  458.                                     whichChannel: LONGINT);
  459.     inline
  460.         $203C, $0004, $0010, $A800;
  461.     procedure Exp1to3 (inBuffer: univ Ptr;
  462.                                     outBuffer: univ Ptr;
  463.                                     cnt: LONGINT;
  464.                                     inState: univ Ptr;
  465.                                     outState: univ Ptr;
  466.                                     numChannels: LONGINT;
  467.                                     whichChannel: LONGINT);
  468.     inline
  469.         $203C, $0008, $0010, $A800;
  470.     procedure Comp6to1 (inBuffer: univ Ptr;
  471.                                     outBuffer: univ Ptr;
  472.                                     cnt: LONGINT;
  473.                                     inState: univ Ptr;
  474.                                     outState: univ Ptr;
  475.                                     numChannels: LONGINT;
  476.                                     whichChannel: LONGINT);
  477.     inline
  478.         $203C, $000C, $0010, $A800;
  479.     procedure Exp1to6 (inBuffer: univ Ptr;
  480.                                     outBuffer: univ Ptr;
  481.                                     cnt: LONGINT;
  482.                                     inState: univ Ptr;
  483.                                     outState: univ Ptr;
  484.                                     numChannels: LONGINT;
  485.                                     whichChannel: LONGINT);
  486.     inline
  487.         $203C, $0010, $0010, $A800;
  488.  
  489. { Sound Manager 3.0 and later calls }
  490.     function GetSysBeepVolume (var level: LONGINT): OSErr;
  491.     inline
  492.         $203C, $0224, $0018, $A800;
  493.     function SetSysBeepVolume (level: LONGINT): OSErr;
  494.     inline
  495.         $203C, $0228, $0018, $A800;
  496.     function GetDefaultOutputVolume (var level: LONGINT): OSErr;
  497.     inline
  498.         $203C, $022C, $0018, $A800;
  499.     function SetDefaultOutputVolume (level: LONGINT): OSErr;
  500.     inline
  501.         $203C, $0230, $0018, $A800;
  502.     function GetSoundHeaderOffset (sndHandle: SndListHandle;
  503.                                     var offset: LONGINT): OSErr;
  504.     inline
  505.         $203C, $0404, $0018, $A800;
  506.     function UnsignedFixedMulDiv (value: UnsignedFixed;
  507.                                     multiplier: UnsignedFixed;
  508.                                     divisor: UnsignedFixed): UnsignedFixed;
  509.     inline
  510.         $203C, $060C, $0018, $A800;
  511.     function GetCompressionInfo (compressionID: INTEGER;
  512.                                     format: OSType;
  513.                                     numChannels: INTEGER;
  514.                                     sampleSize: INTEGER;
  515.                                     cp: CompressionInfoPtr): OSErr;
  516.     inline
  517.         $203C, $0710, $0018, $A800;
  518.     function SetSoundPreference (theType: OSType;
  519.                                     var name: Str255;
  520.                                     settings: Handle): OSErr;
  521.     inline
  522.         $203C, $0634, $0018, $A800;
  523.     function GetSoundPreference (theType: OSType;
  524.                                     var name: Str255;
  525.                                     settings: Handle): OSErr;
  526.     inline
  527.         $203C, $0638, $0018, $A800;
  528.  
  529.     const
  530.         uppSndCallBackProcInfo = $000003C0; { PROCEDURE (4 byte param, 4 byte param); }
  531.  
  532.     function NewSndCallBackProc (userRoutine: SndCallBackProcPtr): SndCallBackUPP;
  533.     inline
  534.         $2E9F;
  535.  
  536.     procedure CallSndCallBackProc (chan: SndChannelPtr;
  537.                                     var cmd: SndCommand;
  538.                                     userRoutine: SndCallBackUPP);
  539.     inline
  540.         $205F, $4E90;
  541.  
  542. implementation
  543. end.